<?php

namespace common\models\user;

use Yii;

/**
 * This is the model class for table "{{%user_annual}}".
 *
 * @property int $id
 * @property int $user_id 用户ID
 * @property int $annual_id 年票ID
 * @property int $ticket_no 票单号
 * @property int $type 年票类型
 * @property string $price 年票价格
 * @property int $bleacher_id 区
 * @property string $seat 楼层/区/排/座
 * @property int $status 状态
 * @property int $created_at 创建时间
 * @property int $updated_at 更新时间
 * @property int $deleted_at 删除时间
 */
class UserAnnual extends \common\db\ActiveRecord {

    /**
     * {@inheritdoc}
     */
    public static function tableName() {
        return '{{%user_annual}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules() {
        return [
            [['user_id', 'annual_id', 'ticket_no', 'type', 'bleacher_id', 'status', 'created_at', 'updated_at', 'deleted_at'], 'integer'],
            [['price'], 'number'],
            [['seat'], 'string', 'max' => 100],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels() {
        return [
            'id' => 'ID',
            'user_id' => '用户ID',
            'annual_id' => '年票ID',
            'ticket_no' => '票单号',
            'type' => '年票类型',
            'price' => '年票价格',
            'seat' => '楼层/区/排/座',
            'bleacher_id' => '看台ID',
            'status' => '状态',
            'created_at' => '创建时间',
            'updated_at' => '更新时间',
            'deleted_at' => '删除时间',
        ];
    }

    public function fields() {
        return [
            'id' => 'annual_id',
            'ticket_no',
            'type',
            'price',
            'seat',
        ];
    }

}
